package pps.et5.eit.ex3;

import org.apache.camel.*;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.file.FileMessage;
import org.apache.camel.impl.*;

public class Pipe {
	public static void main(String[] args) { 
		try {

			CamelContext context = new DefaultCamelContext(); 
			context.addRoutes(new RouteBuilder() {
				public void configure() throws Exception { 
					from("file:/tmp/in/")

					.process(new Processor() {
						public void process(Exchange e) throws Exception {
							FileMessage fileIn = (FileMessage) e.getIn(); 
							System.out.println("Echange reçu : " + fileIn); 
							//
							// COMPLETER
						}
					})
					.to("file:/tmp/out/");
				}
			});
			context.start();
		} catch (Throwable t) { t.printStackTrace();
		} 

	}
}
